package com.tiancheng.trade.order.vo.api.res;

import com.tiancheng.trade.order.model.Order;
import com.tiancheng.trade.order.model.SubOrder;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
public class CreateOrderResVO extends Order implements Serializable {

    // 子订单
    private List<SubOrder> subOrders;

    // 优惠券信息
    private List<Coupon> coupons = new ArrayList<>();

    // 会员信息
    private VipInfo vipInfo;

    @Getter
    @Setter
    public static class Coupon {

        // 主订单号
        private String orderId;
        // 优惠券码
        private String couponCode;
        // 优惠券名称
        private String couponName;
        // 优惠金额
        private Integer discount;
        // 关联订单的应付金额
        private Integer amount;
        // 优惠券类型
        private String couponType;
        // 用户id
        private String uid;
        // 产品code
        private String productCode;
    }

    @Getter
    @Setter
    public static class VipInfo {
        // 折扣
        private Integer discount;
        // 折扣金额
        private Integer discountAmount;
        // 使用的云豆数量
        private Integer useBeam;
        // 云豆抵扣金额
        private Integer useBeamAmount;
        // 会员等级
        private String level;
    }
}
